<template>
	<view class="content" :style="{background: `url(${imgPath}storage/home/home_bg.png)`}">
		<view class="box">
			<scroll-view class="announcement" scroll-y>
				<view class="item" v-for="item in list">
					<view class="top">
						<view class="title">
							{{item.title}}
						</view>
						<view class="time">
							{{item.create_time}}
						</view>
					</view>
					<view class="bottom">
						{{item.content}}
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgPath: this.$store.state.user.baseURL,
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				this.$api.noticelist({
					page: 1,
					limit: 100
				}).then(res => {
					this.list = res.data.list
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		min-height: 100vh;
		z-index: -1;
	}

	.box {
		padding: 0 30rpx;
		padding-top: 20rpx;
	}

	.announcement {
		box-sizing: border-box;
		height: calc(100vh - 60rpx);
		background: #fff;
		border-radius: 20rpx;
		padding: 0 30rpx;
	}

	.item {
		padding: 50rpx 0;
		border-bottom: 2rpx solid #ccc;

		.top {
			display: flex;
			justify-content: space-between;

			.title {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #111111;
				line-height: 40rpx;
				text-align: left;
				font-style: normal;
			}

			.time {
				font-family: PingFangSC, PingFang SC;
				font-weight: 600;
				font-size: 24rpx;
				color: #999999;
				line-height: 34rpx;
				text-align: left;
				font-style: normal;
			}
		}

		.bottom {
			padding-top: 20rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #999999;
			line-height: 34rpx;
			text-align: left;
			font-style: normal;
		}
	}
</style>